﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;

namespace SkeletonNET.Crud.Repository
{
    /// <summary>
    /// Readonly version of the repository
    /// </summary>
    /// <typeparam name="TEntity">The type of the entity.</typeparam>
    public interface IReadonlyRepository<TEntity>
        where TEntity : class, IEntity, new()
    {
        /// <summary>
        /// Query the repository
        /// </summary>
        /// <returns>An IQueryable containing types of TEntity.</returns>
        IQueryable<TEntity> GetQuery();
        /// <summary>
        /// Get a list of entities by using its id.
        /// </summary>
        /// <param name="id">The id to retrieve</param>
        /// <returns>IQueryable containing type(s) of TEntity</returns>
        TEntity GetByID(object id);
    }
}